package com.itheima01;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Homework2 {
    public static void main(String[] args) throws ParseException {
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入您的生日:");
        String s=sc.nextLine();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy年MM月dd日");
        Date d1=new Date();
        long time = sdf.parse(s).getTime();
        long time1 = d1.getTime();
        //        System.out.println(time);
        //        System.out.println(time1);
        if(time>time1){
            System.out.println("生日必须要早于当前日期!");
        }else{
            long time2=(time1-time)/(1000*60*60*24);
            System.out.println("您已经活了"+time2+"天");
        }

    }



}

